<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>Dires - the Php Redis Admin UI</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
    <script type="text/javascript" src="http://cdn.jquerytools.org/1.2.5/all/jquery.tools.min.js"></script>
    <script type="text/javascript" src="<?php echo Kohana::config('dires.assets_url') ?>/js/jquery.tmpl.min.js"></script>
    <script type="text/javascript" src="<?php echo Kohana::config('dires.assets_url') ?>/js/dires_utils.js"></script>
    <link type="text/css" rel="stylesheet" href="<?php echo Kohana::config('dires.assets_url') ?>/css/all.css">
	<script type="text/javascript">
		Dires_Utils.assets_url = '<?php echo Kohana::config('dires.assets_url') ?>';
		Dires_Utils.base_url = '<?php echo Kohana::$base_url ?>';
	</script>
</head>

<body>
	<div class="page">
        <div class="head line">
            <div class="left">
                <a href="<?php echo URL::site(Route::get('dires')->uri(array('controller'=>'dires', 'action'=>'index')), null, false) ?>">Dires - the Php Redis Admin UI</a>
            </div>
        </div>
        <div class="body">
            <div class="page_message"></div>
            <?php
            if ($__message = Dires_Utils::get_page_message()) {?>
            <script type="text/javascript">
                $(function() {
                    Dires_Utils.page_message('<?php echo HTML::entities(I18n::get($__message['message']));?>', <?php echo $__message['type'];?>);
                });
            </script>
            <?php }?>

            <div class="leftCol gCal">
                <div class="widget">
                    <h3>Change Database</h3>
                    <div class="inner">
						<form id="db_change_form" action="<?php echo URL::site(Route::get('dires')->uri(array('controller'=>'dires', 'action'=>'change_db')), null, false) ?>" method="post">
							<?php echo Form::select('db', array_combine(range(1,15), range(1,15)), Session::instance()->get('dires_db'), array('class'=>'number', 'id'=>'db')) ?>
						</form>
                    </div>
                </div>

                <div class="widget">
                    <h3>Menu</h3>
                    <div class="inner">
                        <ul>
                            <li><a class="overlay_trigger" rel="#overlay_addpattern" data-width="350" href="<?php echo URL::site(Route::get('dires')->uri(array('controller'=>'dires', 'action'=>'pattern_add')), null, false) ?>">Add Pattern</a></li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="main">
                <?php echo !empty($content) ? $content : ''; ?>
            </div>
        </div>
        <div class="foot">
            <p>Created by <a href="http://twitter.com/dancaragea">Dan Caragea</a></p>
        </div>
    </div>

	<div id="confirmation_overlay" class="overlay shadow">
		<div class="block">
			<h3></h3>
		</div>

		<div class="block">
			<input class="button yes" type="button" value="<?php echo I18n::get('yes')?>">
			<input class="button no" type="button" value="<?php echo I18n::get('no')?>">
		</div>
	</div>

	<div id="general_overlay" class="overlay shadow">
		<a class="close">close</a>
		<div class="block inner">
		</div>
	</div>

	<div id="overlay_addpattern" class="overlay shadow">
		<a class="close">close</a>
		<h4>Add a pattern</h4>
		<div class="block inner">
            <form action="<?php echo URL::site(Route::get('dires')->uri(array('controller'=>'dires', 'action'=>'pattern_add')), null, false) ?>" method="post">
                <input type="text" name="pattern" />
                <input type="submit" value="add" />
            </form>
		</div>
	</div>
</body>
</html>